    function isSpace(str){
        if(str == ""){
            return true;
        }
        var re = new RegExp("^[ ]+$");
        return re.test(str);
    }

    function isCheckedAtLeastOne(arr) {
        var flag = false ;
        for(var i = 0 ; i < arr.length ; i++){
            if(arr[i].checked){
                flag = true ;
                break ;
            }
        }
        return flag;
    }
    

	function checkEmptyClass() {
		var list = document.getElementsByClassName('backColorChangeable');
		var rel = [];// 存所有backColorChangeable修饰的div节点
		for (var i = 0; i < list.length; i++) {
			if (list[i].nodeName === 'DIV') {
				rel.push(list[i]);
			}
		}
		for (var k = 0; k < rel.length; k++) {
			var nodes = getChildNode(rel[k]);// 某一个backColorChangeable修饰的div节点的所有子节点
			var textNodes = [];// 存上述节点下所有含输入项的节点
			var pickNodes = [];// 存上述节点下所有含选择项的节点（只能有一个题，否则不对）
			for (var j = 0; j < nodes.length; j++) {
				if (nodes[j].nodeName === "TEXTAREA" || nodes[j].type === "text") {
					textNodes.push(nodes[j]);
				}
				if (nodes[j].type === "radio" || nodes[j].type === "checkbox") {
					pickNodes.push(nodes[j]);
				}
			}
			if (textNotAllFilled(textNodes) && noPickOnePicked(pickNodes)) {
				rel[k].style.backgroundColor = "#FFECEC";
			} else {
				rel[k].style.backgroundColor = "";
			}
		}
	}

    function textNotAllFilled(textNodes){
    	if(textNodes.length == 0){
    		return true;
    	}
    	var flag = false;
    	for(var i = 0; i< textNodes.length; i++){
    		if(textNodes[i].value == "" || isSpace(textNodes[i].value)){
    			flag = true;// 只要有一项没有输入就改变背景色
    		}
    	}
    	return flag;
    }
    
    function noPickOnePicked(pickNodes){
    	if(pickNodes.length == 0){
    		return true;
    	}
    	var flag = true;
    	for(var i = 0; i< pickNodes.length; i++){
    		if (pickNodes[i].checked) {
    			flag = false;// 只要有一项被选中就不改变背景色
    		}
    	}
    	return flag;
    }
    
    function getChildNode(node) {
        var nodes = node.childNodes;
        var arr = [];
        for(var i = 0; i < nodes.length; i++){
            var childNode = nodes[i];
            if(childNode.nodeType == 1){
                arr.push(childNode);
                var temp = getChildNode(childNode);
                arr = arr.concat(temp);
            }
        }
        return arr;
    }